// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 区域树 GET /api/area/tree */
export async function queryAreaTree(options?: { [key: string]: any }) {
  return request<API.TreeNodeItem[]>('/api/area/tree', {
    method: 'GET',
    params: {
      ...options,
    },
    ...(options || {}),
  });
}

/** 获取设备类型列表 GET /api/area */
export async function queryArea(
  params: {
    // query
    /** 当前的页码 */
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
  },
  options?: { [key: string]: any },
) {
  return request<API.RequestData>('/api/area', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
/** 获取设备类型列表 GET /api/area */
export async function queryAreaList(
  params: {
    // query
    /** 当前的页码 */
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
  },
  options?: { [key: string]: any },
) {
  return request<API.RequestData>('/api/area/list', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}




/** 更新区域 PUT /api/area */
export async function updateArea(body: API.AreaItem, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/area', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 添加区域 POST /api/area */
export async function addArea(body: API.AreaItem, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/area', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 根据id删除区域 DELETE /api/area */
export async function removeArea(
  params: {
    // query
    /** 区域Id */
    areaId?: number;
  },
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/area', {
    method: 'DELETE',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}



